<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title><?php echo ($name); ?></title>
<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;z-index:0;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;z-index:999;border:1px solid #DFDFDF;background-color:#DFDFDF;padding:5px;height:20px}
</style>

<div class="cat" style="margin-top:5px;">
<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="40">排序</td>
		<td class="title" width="100">品牌</td>
		<td class="title" width="100">logo</td>
		<td class="title" width="100">url</td>
		<td class="title" width="100">推荐</td>
		<td class="title">　</td>
	</tr>
	<tr height="20" bgcolor="#F1F5FA" class="cat_list">
		<td width="40"><input type="text" name="sorting" value="<?php echo ($brand["sorting"]); ?>" size="5"></td>
		<td width="100"><input type="text" name="bname" value="<?php echo ($brand["brand_name"]); ?>"></td>
		<td width="100"><input type="text" name="blogo" value="<?php echo ($brand["brand_logo"]); ?>"></td>
		<td width="100"><input type="text" name="burl" value="<?php echo ($brand["brand_url"]); ?>"></td>
		<td width="100">
<?php if($brand["is_hot"] == 'false' ): ?><input type="radio" value="false" name="ishot" checked>否
        <input type="radio" value="true"  name="ishot">是
<?php else: ?>
        <input type="radio" value="false" name="ishot">否
        <input type="radio" value="true"  name="ishot" checked>是<?php endif; ?>
		</td>
		<td></td>
	</tr>
</table>
</div>

<input type="text" name="bid" value="<?php echo ($brand["brand_id"]); ?>" style="display:none">
<div id="save"><input type="button" id="change" value="保存修改"></div>

<script>
$(function(){
   $("#change").click(function(){
       var bid=$("[name=bid]").val();
	   var sort=$("[name=sorting]").val();
	   var bname=$("[name=bname]").val();
	   var blogo=$("[name=blogo]").val();
	   var burl=$("[name=url]").val();
	   var ishot=$("[name=ishot]:checked").val();
	   
	   $.ajax({
	       type:"POST",
		   url:"__URL__/save_edit",
		   dataType:"json",
		   data:{'bid':bid,'sort':sort,'bname':bname,'blogo':blogo,'burl':burl,'ishot':ishot},
		   success:function(data){
		     if(data=='1'){
			 jSuccess("<strong>修改成功!</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }else{
			 jError("<strong>修改失败!请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }
		   }
	   })


   })

})
</script>